home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QuickTimeMusic.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  72.0 KB  |  1,655 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QuickTimeMusic.p
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 3.0
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT QuickTimeMusic;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __QUICKTIMEMUSIC__}
  27. {$SETC __QUICKTIMEMUSIC__ := 1}
  28.  
  29. {$I+}
  30. {$SETC QuickTimeMusicIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __COMPONENTS__}
  34. {$I Components.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __IMAGECOMPRESSION__}
  37. {$I ImageCompression.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __MOVIES__}
  40. {$I Movies.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED __QUICKDRAW__}
  43. {$I Quickdraw.p}
  44. {$ENDC}
  45. {$IFC UNDEFINED __VIDEO__}
  46. {$I Video.p}
  47. {$ENDC}
  48. {$IFC UNDEFINED __MACMEMORY__}
  49. {$I MacMemory.p}
  50. {$ENDC}
  51. {$IFC UNDEFINED __SOUND__}
  52. {$I Sound.p}
  53. {$ENDC}
  54. {$IFC UNDEFINED __ENDIAN__}
  55. {$I Endian.p}
  56. {$ENDC}
  57.  
  58.  
  59. {$PUSH}
  60. {$ALIGN MAC68K}
  61. {$LibExport+}
  62.  
  63.  
  64. CONST
  65.     kaiToneDescType                = 'tone';
  66.     kaiNoteRequestInfoType        = 'ntrq';
  67.     kaiKnobListType                = 'knbl';
  68.     kaiKeyRangeInfoType            = 'sinf';
  69.     kaiSampleDescType            = 'sdsc';
  70.     kaiSampleInfoType            = 'smin';
  71.     kaiSampleDataType            = 'sdat';
  72.     kaiSampleDataQUIDType        = 'quid';
  73.     kaiInstInfoType                = 'iinf';
  74.     kaiPictType                    = 'pict';
  75.     kaiWriterType                = '©wrt';
  76.     kaiCopyrightType            = '©cpy';
  77.     kaiOtherStrType                = 'str ';
  78.     kaiInstrumentRefType        = 'iref';
  79.     kaiInstGMQualityType        = 'qual';
  80.     kaiLibraryInfoType            = 'linf';
  81.     kaiLibraryDescType            = 'ldsc';
  82.  
  83.  
  84. TYPE
  85.     InstLibDescRecPtr = ^InstLibDescRec;
  86.     InstLibDescRec = RECORD
  87.         libIDName:                Str31;
  88.     END;
  89.  
  90.     InstKnobRecPtr = ^InstKnobRec;
  91.     InstKnobRec = RECORD
  92.         number:                    BigEndianLong;
  93.         value:                    BigEndianLong;
  94.     END;
  95.  
  96.  
  97. CONST
  98.     kInstKnobMissingUnknown        = 0;
  99.     kInstKnobMissingDefault        = $01;
  100.  
  101.  
  102. TYPE
  103.     InstKnobListPtr = ^InstKnobList;
  104.     InstKnobList = RECORD
  105.         knobCount:                BigEndianLong;
  106.         knobFlags:                BigEndianLong;
  107.         knob:                    ARRAY [0..0] OF InstKnobRec;
  108.     END;
  109.  
  110.  
  111. CONST
  112.     kMusicLoopTypeNormal        = 0;
  113.     kMusicLoopTypePalindrome    = 1;                            {  back & forth }
  114.  
  115.     instSamplePreProcessFlag    = $01;
  116.  
  117.  
  118. TYPE
  119.     InstSampleDescRecPtr = ^InstSampleDescRec;
  120.     InstSampleDescRec = RECORD
  121.         dataFormat:                BigEndianOSType;
  122.         numChannels:            BigEndianShort;
  123.         sampleSize:                BigEndianShort;
  124.         sampleRate:                BigEndianUnsignedFixed;
  125.         sampleDataID:            BigEndianShort;
  126.         offset:                    BigEndianLong;                            {  offset within SampleData - this could be just for internal use }
  127.         numSamples:                BigEndianLong;                            {  this could also just be for internal use, we'll see }
  128.         loopType:                BigEndianLong;
  129.         loopStart:                BigEndianLong;
  130.         loopEnd:                BigEndianLong;
  131.         pitchNormal:            BigEndianLong;
  132.         pitchLow:                BigEndianLong;
  133.         pitchHigh:                BigEndianLong;
  134.     END;
  135.  
  136.     AtomicInstrument                    = Handle;
  137.     AtomicInstrumentPtr                    = Ptr;
  138.  
  139. CONST
  140.     kQTMIDIComponentType        = 'midi';
  141.  
  142.     kOMSComponentSubType        = 'OMS ';
  143.     kFMSComponentSubType        = 'FMS ';
  144.     kMIDIManagerComponentSubType = 'mmgr';
  145.  
  146.  
  147. TYPE
  148.     QTMIDIComponent                        = ComponentInstance;
  149.  
  150. CONST
  151.     kMusicPacketPortLost        = 1;                            {  received when application loses the default input port  }
  152.     kMusicPacketPortFound        = 2;                            {  received when application gets it back out from under someone else's claim  }
  153.     kMusicPacketTimeGap            = 3;                            {  data[0] = number of milliseconds to keep the MIDI line silent  }
  154.  
  155.     kAppleSysexID                = $11;                            {  apple sysex is followed by 2-byte command. 0001 is the command for samplesize  }
  156.     kAppleSysexCmdSampleSize    = $0001;                        {  21 bit number in 3 midi bytes follows sysex ID and 2 cmd bytes  }
  157.     kAppleSysexCmdSampleBreak    = $0002;                        {  specifies that the sample should break right here  }
  158.     kAppleSysexCmdAtomicInstrument = $0010;                        {  contents of atomic instrument handle  }
  159.     kAppleSysexCmdDeveloper        = $7F00;                        {  F0 11 7F 00 ww xx yy zz ... F7 is available for non-Apple developers, where wxyz is unique app signature with 8th bit cleared, unique to developer, and 00 and 7f are reserved  }
  160.  
  161.  
  162. TYPE
  163.     MusicMIDIPacketPtr = ^MusicMIDIPacket;
  164.     MusicMIDIPacket = RECORD
  165.         length:                    UInt16;
  166.         reserved:                UInt32;                                    {  if length zero, then reserved = above enum  }
  167.         data:                    PACKED ARRAY [0..248] OF UInt8;
  168.     END;
  169.  
  170. {$IFC TYPED_FUNCTION_POINTERS}
  171.     MusicMIDISendProcPtr = FUNCTION(self: ComponentInstance; refCon: LONGINT; VAR mmp: MusicMIDIPacket): ComponentResult;
  172. {$ELSEC}
  173.     MusicMIDISendProcPtr = ProcPtr;
  174. {$ENDC}
  175.  
  176.     MusicMIDISendUPP = UniversalProcPtr;
  177. {$IFC TYPED_FUNCTION_POINTERS}
  178.     MusicMIDIReadHookProcPtr = FUNCTION(VAR mp: MusicMIDIPacket; myRefCon: LONGINT): ComponentResult;
  179. {$ELSEC}
  180.     MusicMIDIReadHookProcPtr = ProcPtr;
  181. {$ENDC}
  182.  
  183.     MusicMIDIReadHookUPP = UniversalProcPtr;
  184.  
  185. CONST
  186.     kSynthesizerConnectionFMS    = 1;                            {  this connection imported from FMS  }
  187.     kSynthesizerConnectionMMgr    = 2;                            {  this connection imported from the MIDI Mgr  }
  188.     kSynthesizerConnectionOMS    = 4;                            {  this connection imported from OMS  }
  189.     kSynthesizerConnectionQT    = 8;                            {  this connection is a QuickTime-only port  }
  190.                                                                 {  lowest four bits are mutually exclusive; combinations reserved for future use. }
  191.     kSynthesizerConnectionUnavailable = 256;                    {  port exists, but cannot be used just now  }
  192.  
  193.  
  194. TYPE
  195.     SynthesizerConnectionsPtr = ^SynthesizerConnections;
  196.     SynthesizerConnections = RECORD
  197.         clientID:                OSType;
  198.         inputPortID:            OSType;                                    {  terminology death: this port is used to SEND to the midi synth  }
  199.         outputPortID:            OSType;                                    {  terminology death: this port receives from a keyboard or other control device  }
  200.         midiChannel:            LONGINT;                                {  The system channel; others are configurable (or the nubus slot number)  }
  201.         flags:                    LONGINT;
  202.         unique:                    LONGINT;                                {  unique id may be used instead of index, to getinfo and unregister calls  }
  203.         reserved1:                LONGINT;                                {  should be zero  }
  204.         reserved2:                LONGINT;                                {  should be zero  }
  205.     END;
  206.  
  207.     QTMIDIPortPtr = ^QTMIDIPort;
  208.     QTMIDIPort = RECORD
  209.         portConnections:        SynthesizerConnections;
  210.         portName:                Str63;
  211.     END;
  212.  
  213.     QTMIDIPortListPtr = ^QTMIDIPortList;
  214.     QTMIDIPortList = RECORD
  215.         portCount:                INTEGER;
  216.         port:                    ARRAY [0..0] OF QTMIDIPort;
  217.     END;
  218.  
  219.     QTMIDIPortListHandle                = ^QTMIDIPortListPtr;
  220. FUNCTION QTMIDIGetMIDIPorts(ci: QTMIDIComponent; VAR inputPorts: QTMIDIPortListHandle; VAR outputPorts: QTMIDIPortListHandle): ComponentResult;
  221.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  222.     INLINE $2F3C, $0008, $0001, $7000, $A82A;
  223.     {$ENDC}
  224. FUNCTION QTMIDIUseSendPort(ci: QTMIDIComponent; portIndex: LONGINT; inUse: LONGINT): ComponentResult;
  225.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  226.     INLINE $2F3C, $0008, $0002, $7000, $A82A;
  227.     {$ENDC}
  228. FUNCTION QTMIDISendMIDI(ci: QTMIDIComponent; portIndex: LONGINT; VAR mp: MusicMIDIPacket): ComponentResult;
  229.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  230.     INLINE $2F3C, $0008, $0003, $7000, $A82A;
  231.     {$ENDC}
  232. FUNCTION QTMIDIUseReceivePort(ci: QTMIDIComponent; portIndex: LONGINT; readHook: MusicMIDIReadHookUPP; refCon: LONGINT): ComponentResult;
  233.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  234.     INLINE $2F3C, $000C, $0004, $7000, $A82A;
  235.     {$ENDC}
  236.  
  237.  
  238.  
  239. CONST
  240.     kMusicComponentType            = 'musi';
  241.     kInstrumentComponentType    = 'inst';
  242.  
  243.     kSoftSynthComponentSubType    = 'ss  ';
  244.     kGMSynthComponentSubType    = 'gm  ';
  245.  
  246.  
  247.  
  248. TYPE
  249.     MusicComponent                        = ComponentInstance;
  250. {  MusicSynthesizerFlags }
  251.  
  252. CONST
  253.     kSynthesizerDynamicVoice    = $01;                            {  can assign voices on the fly (else, polyphony is very important  }
  254.     kSynthesizerUsesMIDIPort    = $02;                            {  must be patched through MIDI Manager  }
  255.     kSynthesizerMicrotone        = $04;                            {  can play microtonal scales  }
  256.     kSynthesizerHasSamples        = $08;                            {  synthesizer has some use for sampled data  }
  257.     kSynthesizerMixedDrums        = $10;                            {  any part can play drum parts, total = instrument parts  }
  258.     kSynthesizerSoftware        = $20;                            {  implemented in main CPU software == uses cpu cycles  }
  259.     kSynthesizerHardware        = $40;                            {  is a hardware device (such as nubus, or maybe DSP?)  }
  260.     kSynthesizerDynamicChannel    = $80;                            {  can move any part to any channel or disable each part. (else we assume it lives on all channels in masks)  }
  261.     kSynthesizerHogsSystemChannel = $0100;                        {  can be channelwise dynamic, but always responds on its system channel  }
  262.     kSynthesizerHasSystemChannel = $0200;                        {  has some "system channel" notion to distinguish it from multiple instances of the same device (GM devices dont)  }
  263.     kSynthesizerSlowSetPart        = $0400;                        {  SetPart() and SetPartInstrumentNumber() calls do not have rapid response, may glitch notes  }
  264.     kSynthesizerOffline            = $1000;                        {  can enter an offline synthesis mode  }
  265.     kSynthesizerGM                = $4000;                        {  synth is a GM device  }
  266.     kSynthesizerDLS                = $8000;                        {  synth supports DLS level 1  }
  267.     kSynthesizerSoundLocalization = $00010000;                    {  synth supports extremely baroque, nonstandard, and proprietary "apple game sprockets" localization parameter set  }
  268.  
  269. {
  270.  * Note that these controller numbers
  271.  * are _not_ identical to the MIDI controller numbers.
  272.  * These are _signed_ 8.8 values, and the LSB's are
  273.  * always sent to a MIDI device. Controllers 32-63 are
  274.  * reserved (for MIDI, they are LSB's for 0-31, but we
  275.  * always send both).
  276.  *
  277.  * The full range, therefore, is -128.00 to 127.7f.
  278.  *
  279.  * _Excepting_ _volume_, all controls default to zero.
  280.  *
  281.  * Pitch bend is specified in fractional semitones! No
  282.  * more "pitch bend range" nonsense. You can bend as far
  283.  * as you want, any time you want.
  284.  }
  285.  
  286. TYPE
  287.     MusicController                        = SInt32;
  288.  
  289. CONST
  290.     kControllerModulationWheel    = 1;
  291.     kControllerBreath            = 2;
  292.     kControllerFoot                = 4;
  293.     kControllerPortamentoTime    = 5;                            {  time in 8.8 seconds, portamento on/off is omitted, 0 time = 'off'  }
  294.     kControllerVolume            = 7;                            {  main volume control  }
  295.     kControllerBalance            = 8;
  296.     kControllerPan                = 10;                            {  0 - "default", 1 - n: positioned in output 1-n (incl fractions)  }
  297.     kControllerExpression        = 11;                            {  secondary volume control  }
  298.     kControllerLever1            = 16;                            {  general purpose controllers  }
  299.     kControllerLever2            = 17;                            {  general purpose controllers  }
  300.     kControllerLever3            = 18;                            {  general purpose controllers  }
  301.     kControllerLever4            = 19;                            {  general purpose controllers  }
  302.     kControllerLever5            = 80;                            {  general purpose controllers  }
  303.     kControllerLever6            = 81;                            {  general purpose controllers  }
  304.     kControllerLever7            = 82;                            {  general purpose controllers  }
  305.     kControllerLever8            = 83;                            {  general purpose controllers  }
  306.     kControllerPitchBend        = 32;                            {  positive & negative semitones, with 8 bits fraction, same units as transpose controllers }
  307.     kControllerAfterTouch        = 33;                            {  aka channel pressure  }
  308.     kControllerPartTranspose    = 40;                            {  identical to pitchbend, for overall part xpose  }
  309.     kControllerTuneTranspose    = 41;                            {  another pitchbend, for "song global" pitch offset  }
  310.     kControllerPartVolume        = 42;                            {  another volume control, passed right down from note allocator part volume  }
  311.     kControllerTuneVolume        = 43;                            {  another volume control, used for "song global" volume - since we share one synthesizer across multiple tuneplayers }
  312.     kControllerSustain            = 64;                            {  boolean - positive for on, 0 or negative off  }
  313.     kControllerPortamento        = 65;                            {  boolean }
  314.     kControllerSostenuto        = 66;                            {  boolean  }
  315.     kControllerSoftPedal        = 67;                            {  boolean  }
  316.     kControllerReverb            = 91;
  317.     kControllerTremolo            = 92;
  318.     kControllerChorus            = 93;
  319.     kControllerCeleste            = 94;
  320.     kControllerPhaser            = 95;
  321.     kControllerEditPart            = 113;                            {  last 16 controllers 113-128 and above are global controllers which respond on part zero  }
  322.     kControllerMasterTune        = 114;
  323.     kControllerMasterTranspose    = 114;                            {  preferred }
  324.     kControllerMasterVolume        = 115;
  325.     kControllerMasterCPULoad    = 116;
  326.     kControllerMasterPolyphony    = 117;
  327.     kControllerMasterFeatures    = 118;
  328.  
  329.  
  330. {  ID's of knobs supported by the QuickTime Music Synthesizer built into QuickTime }
  331.  
  332.     kQTMSKnobStartID            = $02000000;
  333.     kQTMSKnobVolumeAttackTimeID    = $02000001;
  334.     kQTMSKnobVolumeDecayTimeID    = $02000002;
  335.     kQTMSKnobVolumeSustainLevelID = $02000003;
  336.     kQTMSKnobVolumeRelease1RateID = $02000004;
  337.     kQTMSKnobVolumeDecayKeyScalingID = $02000005;
  338.     kQTMSKnobVolumeReleaseTimeID = $02000006;
  339.     kQTMSKnobVolumeLFODelayID    = $02000007;
  340.     kQTMSKnobVolumeLFORampTimeID = $02000008;
  341.     kQTMSKnobVolumeLFOPeriodID    = $02000009;
  342.     kQTMSKnobVolumeLFOShapeID    = $0200000A;
  343.     kQTMSKnobVolumeLFODepthID    = $0200000B;
  344.     kQTMSKnobVolumeOverallID    = $0200000C;
  345.     kQTMSKnobVolumeVelocity127ID = $0200000D;
  346.     kQTMSKnobVolumeVelocity96ID    = $0200000E;
  347.     kQTMSKnobVolumeVelocity64ID    = $0200000F;
  348.     kQTMSKnobVolumeVelocity32ID    = $02000010;
  349.     kQTMSKnobVolumeVelocity16ID    = $02000011;                    {  Pitch related knobs }
  350.     kQTMSKnobPitchTransposeID    = $02000012;
  351.     kQTMSKnobPitchLFODelayID    = $02000013;
  352.     kQTMSKnobPitchLFORampTimeID    = $02000014;
  353.     kQTMSKnobPitchLFOPeriodID    = $02000015;
  354.     kQTMSKnobPitchLFOShapeID    = $02000016;
  355.     kQTMSKnobPitchLFODepthID    = $02000017;
  356.     kQTMSKnobPitchLFOQuantizeID    = $02000018;                    {  Stereo related knobs }
  357.     kQTMSKnobStereoDefaultPanID    = $02000019;
  358.     kQTMSKnobStereoPositionKeyScalingID = $0200001A;
  359.     kQTMSKnobPitchLFOOffsetID    = $0200001B;
  360.     kQTMSKnobExclusionGroupID    = $0200001C;                    {  Misc knobs, late additions }
  361.     kQTMSKnobSustainTimeID        = $0200001D;
  362.     kQTMSKnobSustainInfiniteID    = $0200001E;
  363.     kQTMSKnobVolumeLFOStereoID    = $0200001F;
  364.     kQTMSKnobVelocityLowID        = $02000020;
  365.     kQTMSKnobVelocityHighID        = $02000021;
  366.     kQTMSKnobVelocitySensitivityID = $02000022;
  367.     kQTMSKnobPitchSensitivityID    = $02000023;
  368.     kQTMSKnobVolumeLFODepthFromWheelID = $02000024;
  369.     kQTMSKnobPitchLFODepthFromWheelID = $02000025;                {  Volume Env again }
  370.     kQTMSKnobVolumeExpOptionsID    = $02000026;                    {  Env1 }
  371.     kQTMSKnobEnv1AttackTimeID    = $02000027;
  372.     kQTMSKnobEnv1DecayTimeID    = $02000028;
  373.     kQTMSKnobEnv1SustainLevelID    = $02000029;
  374.     kQTMSKnobEnv1SustainTimeID    = $0200002A;
  375.     kQTMSKnobEnv1SustainInfiniteID = $0200002B;
  376.     kQTMSKnobEnv1ReleaseTimeID    = $0200002C;
  377.     kQTMSKnobEnv1ExpOptionsID    = $0200002D;                    {  Env2 }
  378.     kQTMSKnobEnv2AttackTimeID    = $0200002E;
  379.     kQTMSKnobEnv2DecayTimeID    = $0200002F;
  380.     kQTMSKnobEnv2SustainLevelID    = $02000030;
  381.     kQTMSKnobEnv2SustainTimeID    = $02000031;
  382.     kQTMSKnobEnv2SustainInfiniteID = $02000032;
  383.     kQTMSKnobEnv2ReleaseTimeID    = $02000033;
  384.     kQTMSKnobEnv2ExpOptionsID    = $02000034;                    {  Pitch Env }
  385.     kQTMSKnobPitchEnvelopeID    = $02000035;
  386.     kQTMSKnobPitchEnvelopeDepthID = $02000036;                    {  Filter }
  387.     kQTMSKnobFilterKeyFollowID    = $02000037;
  388.     kQTMSKnobFilterTransposeID    = $02000038;
  389.     kQTMSKnobFilterQID            = $02000039;
  390.     kQTMSKnobFilterFrequencyEnvelopeID = $0200003A;
  391.     kQTMSKnobFilterFrequencyEnvelopeDepthID = $0200003B;
  392.     kQTMSKnobFilterQEnvelopeID    = $0200003C;
  393.     kQTMSKnobFilterQEnvelopeDepthID = $0200003D;                {  Reverb Threshhold }
  394.     kQTMSKnobReverbThresholdID    = $0200003E;
  395.     kQTMSKnobVolumeAttackVelScalingID = $0200003F;
  396.     kQTMSKnobLastIDPlus1        = $02000040;
  397.  
  398.  
  399.  
  400.  
  401.     kControllerMaximum            = $00007FFF;                    {  +01111111.11111111  }
  402.     kControllerMinimum            = $FFFF8000;                    {  -10000000.00000000  }
  403.  
  404.  
  405. TYPE
  406.     SynthesizerDescriptionPtr = ^SynthesizerDescription;
  407.     SynthesizerDescription = RECORD
  408.         synthesizerType:        OSType;                                    {  synthesizer type (must be same as component subtype)  }
  409.         name:                    Str31;                                    {  text name of synthesizer type  }
  410.         flags:                    UInt32;                                    {  from the above enum  }
  411.         voiceCount:                UInt32;                                    {  maximum polyphony  }
  412.         partCount:                UInt32;                                    {  maximum multi-timbrality (and midi channels)  }
  413.         instrumentCount:        UInt32;                                    {  non gm, built in (rom) instruments only  }
  414.         modifiableInstrumentCount: UInt32;                                {  plus n-more are user modifiable  }
  415.         channelMask:            UInt32;                                    {  (midi device only) which channels device always uses  }
  416.         drumPartCount:            UInt32;                                    {  maximum multi-timbrality of drum parts  }
  417.         drumCount:                UInt32;                                    {  non gm, built in (rom) drumkits only  }
  418.         modifiableDrumCount:    UInt32;                                    {  plus n-more are user modifiable  }
  419.         drumChannelMask:        UInt32;                                    {  (midi device only) which channels device always uses  }
  420.         outputCount:            UInt32;                                    {  number of audio outputs (usually two)  }
  421.         latency:                UInt32;                                    {  response time in µSec  }
  422.         controllers:            ARRAY [0..3] OF UInt32;                    {  array of 128 bits  }
  423.         gmInstruments:            ARRAY [0..3] OF UInt32;                    {  array of 128 bits  }
  424.         gmDrums:                ARRAY [0..3] OF UInt32;                    {  array of 128 bits  }
  425.     END;
  426.  
  427.  
  428. CONST
  429.     kVoiceCountDynamic            = -1;                            {  constant to use to specify dynamic voicing  }
  430.  
  431.  
  432.  
  433. TYPE
  434.     ToneDescriptionPtr = ^ToneDescription;
  435.     ToneDescription = RECORD
  436.         synthesizerType:        BigEndianOSType;                        {  synthesizer type  }
  437.         synthesizerName:        Str31;                                    {  name of instantiation of synth  }
  438.         instrumentName:            Str31;                                    {  preferred name for human use  }
  439.         instrumentNumber:        BigEndianLong;                            {  inst-number used if synth-name matches  }
  440.         gmNumber:                BigEndianLong;                            {  Best matching general MIDI number  }
  441.     END;
  442.  
  443.  
  444. CONST
  445.     kFirstGMInstrument            = $00000001;
  446.     kLastGMInstrument            = $00000080;
  447.     kFirstGSInstrument            = $00000081;
  448.     kLastGSInstrument            = $00003FFF;
  449.     kFirstDrumkit                = $00004000;                    {  (first value is "no drum". instrument numbers from 16384->16384+128 are drumkits, and for GM they are _defined_ drumkits!  }
  450.     kLastDrumkit                = $00004080;
  451.     kFirstROMInstrument            = $00008000;
  452.     kLastROMInstrument            = $0000FFFF;
  453.     kFirstUserInstrument        = $00010000;
  454.     kLastUserInstrument            = $0001FFFF;
  455.  
  456. {  InstrumentMatch }
  457.     kInstrumentMatchSynthesizerType = 1;
  458.     kInstrumentMatchSynthesizerName = 2;
  459.     kInstrumentMatchName        = 4;
  460.     kInstrumentMatchNumber        = 8;
  461.     kInstrumentMatchGMNumber    = 16;
  462.     kInstrumentMatchGSNumber    = 32;
  463.  
  464. {  KnobFlags }
  465.     kKnobBasic                    = 8;                            {  knob shows up in certain simplified lists of knobs  }
  466.     kKnobReadOnly                = 16;                            {  knob value cannot be changed by user or with a SetKnob call  }
  467.     kKnobInterruptUnsafe        = 32;                            {  only alter this knob from foreground task time (may access toolbox)  }
  468.     kKnobKeyrangeOverride        = 64;                            {  knob can be overridden within a single keyrange (software synth only)  }
  469.     kKnobGroupStart                = 128;                            {  knob is first in some logical group of knobs  }
  470.     kKnobFixedPoint8            = 1024;
  471.     kKnobFixedPoint16            = 2048;                            {  One of these may be used at a time.  }
  472.     kKnobTypeNumber                = $00;
  473.     kKnobTypeGroupName            = $1000;                        {  "knob" is really a group name for display purposes  }
  474.     kKnobTypeBoolean            = $2000;                        {  if range is greater than 1, its a multi-checkbox field  }
  475.     kKnobTypeNote                = $3000;                        {  knob range is equivalent to MIDI keys  }
  476.     kKnobTypePan                = $4000;                        {  range goes left/right (lose this? )  }
  477.     kKnobTypeInstrument            = $5000;                        {  knob value = reference to another instrument number  }
  478.     kKnobTypeSetting            = $6000;                        {  knob value is 1 of n different things (eg, fm algorithms) popup menu  }
  479.     kKnobTypeMilliseconds        = $7000;                        {  knob is a millisecond time range  }
  480.     kKnobTypePercentage            = $8000;                        {  knob range is displayed as a Percentage  }
  481.     kKnobTypeHertz                = $9000;                        {  knob represents frequency  }
  482.     kKnobTypeButton                = $A000;                        {  momentary trigger push button  }
  483.  
  484.  
  485.     kUnknownKnobValue            = $7FFFFFFF;                    {  a knob with this value means, we don't know it.  }
  486.     kDefaultKnobValue            = $7FFFFFFE;                    {  used to SET a knob to its default value.  }
  487.  
  488.  
  489. TYPE
  490.     KnobDescriptionPtr = ^KnobDescription;
  491.     KnobDescription = RECORD
  492.         name:                    Str63;
  493.         lowValue:                LONGINT;
  494.         highValue:                LONGINT;
  495.         defaultValue:            LONGINT;                                {  a default instrument is made of all default values  }
  496.         flags:                    LONGINT;
  497.         knobID:                    LONGINT;
  498.     END;
  499.  
  500.     GCInstrumentDataPtr = ^GCInstrumentData;
  501.     GCInstrumentData = RECORD
  502.         tone:                    ToneDescription;
  503.         knobCount:                LONGINT;
  504.         knob:                    ARRAY [0..0] OF LONGINT;
  505.     END;
  506.  
  507.     GCInstrumentDataHandle                = ^GCInstrumentDataPtr;
  508.     InstrumentAboutInfoPtr = ^InstrumentAboutInfo;
  509.     InstrumentAboutInfo = RECORD
  510.         p:                        PicHandle;
  511.         author:                    Str255;
  512.         copyright:                Str255;
  513.         other:                    Str255;
  514.     END;
  515.  
  516.  
  517.  
  518. CONST
  519.     notImplementedMusicErr        = $8000F7E9;
  520.     cantSendToSynthesizerErr    = $8000F7E8;
  521.     cantReceiveFromSynthesizerErr = $8000F7E7;
  522.     illegalVoiceAllocationErr    = $8000F7E6;
  523.     illegalPartErr                = $8000F7E5;
  524.     illegalChannelErr            = $8000F7E4;
  525.     illegalKnobErr                = $8000F7E3;
  526.     illegalKnobValueErr            = $8000F7E2;
  527.     illegalInstrumentErr        = $8000F7E1;
  528.     illegalControllerErr        = $8000F7E0;
  529.     midiManagerAbsentErr        = $8000F7DF;
  530.     synthesizerNotRespondingErr    = $8000F7DE;
  531.     synthesizerErr                = $8000F7DD;
  532.     illegalNoteChannelErr        = $8000F7DC;
  533.     noteChannelNotAllocatedErr    = $8000F7DB;
  534.     tunePlayerFullErr            = $8000F7DA;
  535.     tuneParseErr                = $8000F7D9;
  536.  
  537.     kGetAtomicInstNoExpandedSamples = $01;
  538.     kGetAtomicInstNoOriginalSamples = $02;
  539.     kGetAtomicInstNoSamples        = $03;
  540.     kGetAtomicInstNoKnobList    = $04;
  541.     kGetAtomicInstNoInstrumentInfo = $08;
  542.     kGetAtomicInstOriginalKnobList = $10;
  543.     kGetAtomicInstAllKnobs        = $20;                            {  return even those that are set to default }
  544.  
  545. {
  546.    For non-gm instruments, instrument number of tone description == 0
  547.    If you want to speed up while running, slam the inst num with what Get instrument number returns
  548.    All missing knobs are slammed to the default value
  549. }
  550.     kSetAtomicInstKeepOriginalInstrument = $01;
  551.     kSetAtomicInstShareAcrossParts = $02;                        {  inst disappears when app goes away }
  552.     kSetAtomicInstCallerTosses    = $04;                            {  the caller isn't keeping a copy around (for NASetAtomicInstrument) }
  553.     kSetAtomicInstCallerGuarantees = $08;                        {  the caller guarantees a copy is around }
  554.     kSetAtomicInstInterruptSafe    = $10;                            {  dont move memory at this time (but process at next task time) }
  555.     kSetAtomicInstDontPreprocess = $80;                            {  perform no further preprocessing because either 1)you know the instrument is digitally clean, or 2) you got it from a GetPartAtomic }
  556.  
  557.     kInstrumentNamesModifiable    = 1;
  558.     kInstrumentNamesBoth        = 2;
  559.  
  560. {
  561.  * Structures specific to the GenericMusicComponent
  562.  }
  563.  
  564.     kGenericMusicComponentSubtype = 'gene';
  565.  
  566.  
  567. TYPE
  568.     GenericKnobDescriptionPtr = ^GenericKnobDescription;
  569.     GenericKnobDescription = RECORD
  570.         kd:                        KnobDescription;
  571.         hw1:                    LONGINT;                                {  driver defined  }
  572.         hw2:                    LONGINT;                                {  driver defined  }
  573.         hw3:                    LONGINT;                                {  driver defined  }
  574.         settingsID:                LONGINT;                                {  resource ID list for boolean and popup names  }
  575.     END;
  576.  
  577.     GenericKnobDescriptionListPtr = ^GenericKnobDescriptionList;
  578.     GenericKnobDescriptionList = RECORD
  579.         knobCount:                LONGINT;
  580.         knob:                    ARRAY [0..0] OF GenericKnobDescription;
  581.     END;
  582.  
  583.     GenericKnobDescriptionListHandle    = ^GenericKnobDescriptionListPtr;
  584. { knobTypes for MusicDerivedSetKnob }
  585.  
  586. CONST
  587.     kGenericMusicKnob            = 1;
  588.     kGenericMusicInstrumentKnob    = 2;
  589.     kGenericMusicDrumKnob        = 3;
  590.     kGenericMusicGlobalController = 4;
  591.  
  592.  
  593.  
  594.     kGenericMusicResFirst        = 0;
  595.     kGenericMusicResMiscStringList = 1;                            {  STR# 1: synth name, 2:about author,3:aboutcopyright,4:aboutother  }
  596.     kGenericMusicResMiscLongList = 2;                            {  Long various params, see list below  }
  597.     kGenericMusicResInstrumentList = 3;                            {  NmLs of names and shorts, categories prefixed by '••'  }
  598.     kGenericMusicResDrumList    = 4;                            {  NmLs of names and shorts  }
  599.     kGenericMusicResInstrumentKnobDescriptionList = 5;            {  Knob  }
  600.     kGenericMusicResDrumKnobDescriptionList = 6;                {  Knob  }
  601.     kGenericMusicResKnobDescriptionList = 7;                    {  Knob  }
  602.     kGenericMusicResBitsLongList = 8;                            {  Long back to back bitmaps of controllers, gminstruments, and drums  }
  603.     kGenericMusicResModifiableInstrumentHW = 9;                    {  Shrt same as the hw shorts trailing the instrument names, a shortlist  }
  604.     kGenericMusicResGMTranslation = 10;                            {  Long 128 long entries, 1 for each gm inst, of local instrument numbers 1-n (not hw numbers)  }
  605.     kGenericMusicResROMInstrumentData = 11;                        {  knob lists for ROM instruments, so the knob values may be known  }
  606.     kGenericMusicResAboutPICT    = 12;                            {  picture for aboutlist. must be present for GetAbout call to work  }
  607.     kGenericMusicResLast        = 13;
  608.  
  609. { elements of the misc long list }
  610.     kGenericMusicMiscLongFirst    = 0;
  611.     kGenericMusicMiscLongVoiceCount = 1;
  612.     kGenericMusicMiscLongPartCount = 2;
  613.     kGenericMusicMiscLongModifiableInstrumentCount = 3;
  614.     kGenericMusicMiscLongChannelMask = 4;
  615.     kGenericMusicMiscLongDrumPartCount = 5;
  616.     kGenericMusicMiscLongModifiableDrumCount = 6;
  617.     kGenericMusicMiscLongDrumChannelMask = 7;
  618.     kGenericMusicMiscLongOutputCount = 8;
  619.     kGenericMusicMiscLongLatency = 9;
  620.     kGenericMusicMiscLongFlags    = 10;
  621.     kGenericMusicMiscLongFirstGMHW = 11;                        {  number to add to locate GM main instruments  }
  622.     kGenericMusicMiscLongFirstGMDrumHW = 12;                    {  number to add to locate GM drumkits  }
  623.     kGenericMusicMiscLongFirstUserHW = 13;                        {  First hw number of user instruments (presumed sequential)  }
  624.     kGenericMusicMiscLongLast    = 14;
  625.  
  626.  
  627. TYPE
  628.     GCPartPtr = ^GCPart;
  629.     GCPart = RECORD
  630.         hwInstrumentNumber:        LONGINT;                                {  internal number of recalled instrument  }
  631.         controller:                ARRAY [0..127] OF INTEGER;                {  current values for all controllers  }
  632.         volume:                    LONGINT;                                {  ctrl 7 is special case  }
  633.         polyphony:                LONGINT;
  634.         midiChannel:            LONGINT;                                {  1-16 if in use  }
  635.         id:                        GCInstrumentData;                        {  ToneDescription & knoblist, uncertain length  }
  636.     END;
  637.  
  638. {
  639.  * Calls specific to the GenericMusicComponent
  640.  }
  641.  
  642. CONST
  643.     kMusicGenericRange            = $0100;
  644.     kMusicDerivedRange            = $0200;
  645.  
  646. {
  647.  * Flags in GenericMusicConfigure call
  648.  }
  649.     kGenericMusicDoMIDI            = $01;                            {  implement normal MIDI messages for note, controllers, and program changes 0-127  }
  650.     kGenericMusicBank0            = $02;                            {  implement instrument bank changes on controller 0  }
  651.     kGenericMusicBank32            = $04;                            {  implement instrument bank changes on controller 32  }
  652.     kGenericMusicErsatzMIDI        = $08;                            {  construct MIDI packets, but send them to the derived component  }
  653.     kGenericMusicCallKnobs        = $10;                            {  call the derived component with special knob format call  }
  654.     kGenericMusicCallParts        = $20;                            {  call the derived component with special part format call  }
  655.     kGenericMusicCallInstrument    = $40;                            {  call MusicDerivedSetInstrument for MusicSetInstrument calls  }
  656.     kGenericMusicCallNumber        = $80;                            {  call MusicDerivedSetPartInstrumentNumber for MusicSetPartInstrumentNumber calls, & don't send any C0 or bank stuff  }
  657.     kGenericMusicCallROMInstrument = $0100;                        {  call MusicSetInstrument for MusicSetPartInstrumentNumber for "ROM" instruments, passing params from the ROMi resource  }
  658.     kGenericMusicAllDefaults    = $0200;                        {  indicates that when a new instrument is recalled, all knobs are reset to DEFAULT settings. True for GS modules  }
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665. TYPE
  666. {$IFC TYPED_FUNCTION_POINTERS}
  667.     MusicOfflineDataProcPtr = FUNCTION(SoundData: Ptr; numBytes: LONGINT; myRefCon: LONGINT): ComponentResult;
  668. {$ELSEC}
  669.     MusicOfflineDataProcPtr = ProcPtr;
  670. {$ENDC}
  671.  
  672.     MusicOfflineDataUPP = UniversalProcPtr;
  673.     OfflineSampleTypePtr = ^OfflineSampleType;
  674.     OfflineSampleType = RECORD
  675.         numChannels:            UInt32;                                    { number of channels,  ie mono = 1 }
  676.         sampleRate:                UnsignedFixed;                            { sample rate in Apples Fixed point representation }
  677.         sampleSize:                UInt16;                                    { number of bits in sample }
  678.     END;
  679.  
  680.     InstrumentInfoRecordPtr = ^InstrumentInfoRecord;
  681.     InstrumentInfoRecord = RECORD
  682.         instrumentNumber:        LONGINT;                                {  instrument number (if 0, name is a catagory) }
  683.         flags:                    LONGINT;                                {  show in picker, etc. }
  684.         toneNameIndex:            LONGINT;                                {  index in toneNames (1 based) }
  685.         itxtNameAtomID:            LONGINT;                                {  index in itxtNames (itxt/name by index) }
  686.     END;
  687.  
  688.     InstrumentInfoListPtr = ^InstrumentInfoList;
  689.     InstrumentInfoList = RECORD
  690.         recordCount:            LONGINT;
  691.         toneNames:                Handle;                                    {  name from tone description }
  692.         itxtNames:                QTAtomContainer;                        {  itxt/name atoms for instruments }
  693.         info:                    ARRAY [0..0] OF InstrumentInfoRecord;
  694.     END;
  695.  
  696.     InstrumentInfoListHandle            = ^InstrumentInfoListPtr;
  697. FUNCTION MusicGetDescription(mc: MusicComponent; VAR sd: SynthesizerDescription): ComponentResult;
  698.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  699.     INLINE $2F3C, $0004, $0001, $7000, $A82A;
  700.     {$ENDC}
  701. FUNCTION MusicGetPart(mc: MusicComponent; part: LONGINT; VAR midiChannel: LONGINT; VAR polyphony: LONGINT): ComponentResult;
  702.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  703.     INLINE $2F3C, $000C, $0002, $7000, $A82A;
  704.     {$ENDC}
  705. FUNCTION MusicSetPart(mc: MusicComponent; part: LONGINT; midiChannel: LONGINT; polyphony: LONGINT): ComponentResult;
  706.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  707.     INLINE $2F3C, $000C, $0003, $7000, $A82A;
  708.     {$ENDC}
  709. FUNCTION MusicSetPartInstrumentNumber(mc: MusicComponent; part: LONGINT; instrumentNumber: LONGINT): ComponentResult;
  710.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  711.     INLINE $2F3C, $0008, $0004, $7000, $A82A;
  712.     {$ENDC}
  713.  
  714. FUNCTION MusicGetPartInstrumentNumber(mc: MusicComponent; part: LONGINT): ComponentResult;
  715.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  716.     INLINE $2F3C, $0004, $0005, $7000, $A82A;
  717.     {$ENDC}
  718. FUNCTION MusicStorePartInstrument(mc: MusicComponent; part: LONGINT; instrumentNumber: LONGINT): ComponentResult;
  719.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  720.     INLINE $2F3C, $0008, $0006, $7000, $A82A;
  721.     {$ENDC}
  722.  
  723. FUNCTION MusicGetPartAtomicInstrument(mc: MusicComponent; part: LONGINT; VAR ai: AtomicInstrument; flags: LONGINT): ComponentResult;
  724.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  725.     INLINE $2F3C, $000C, $0009, $7000, $A82A;
  726.     {$ENDC}
  727. FUNCTION MusicSetPartAtomicInstrument(mc: MusicComponent; part: LONGINT; aiP: AtomicInstrumentPtr; flags: LONGINT): ComponentResult;
  728.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  729.     INLINE $2F3C, $000C, $000A, $7000, $A82A;
  730.     {$ENDC}
  731.  
  732. {  Obsolete calls }
  733. FUNCTION MusicGetInstrumentKnobDescriptionObsolete(mc: MusicComponent; knobIndex: LONGINT; mkd: UNIV Ptr): ComponentResult;
  734.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  735.     INLINE $2F3C, $0008, $000D, $7000, $A82A;
  736.     {$ENDC}
  737. FUNCTION MusicGetDrumKnobDescriptionObsolete(mc: MusicComponent; knobIndex: LONGINT; mkd: UNIV Ptr): ComponentResult;
  738.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  739.     INLINE $2F3C, $0008, $000E, $7000, $A82A;
  740.     {$ENDC}
  741. FUNCTION MusicGetKnobDescriptionObsolete(mc: MusicComponent; knobIndex: LONGINT; mkd: UNIV Ptr): ComponentResult;
  742.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  743.     INLINE $2F3C, $0008, $000F, $7000, $A82A;
  744.     {$ENDC}
  745. FUNCTION MusicGetPartKnob(mc: MusicComponent; part: LONGINT; knobID: LONGINT): ComponentResult;
  746.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  747.     INLINE $2F3C, $0008, $0010, $7000, $A82A;
  748.     {$ENDC}
  749. FUNCTION MusicSetPartKnob(mc: MusicComponent; part: LONGINT; knobID: LONGINT; knobValue: LONGINT): ComponentResult;
  750.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  751.     INLINE $2F3C, $000C, $0011, $7000, $A82A;
  752.     {$ENDC}
  753. FUNCTION MusicGetKnob(mc: MusicComponent; knobID: LONGINT): ComponentResult;
  754.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  755.     INLINE $2F3C, $0004, $0012, $7000, $A82A;
  756.     {$ENDC}
  757. FUNCTION MusicSetKnob(mc: MusicComponent; knobID: LONGINT; knobValue: LONGINT): ComponentResult;
  758.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  759.     INLINE $2F3C, $0008, $0013, $7000, $A82A;
  760.     {$ENDC}
  761. FUNCTION MusicGetPartName(mc: MusicComponent; part: LONGINT; name: StringPtr): ComponentResult;
  762.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  763.     INLINE $2F3C, $0008, $0014, $7000, $A82A;
  764.     {$ENDC}
  765. FUNCTION MusicSetPartName(mc: MusicComponent; part: LONGINT; name: StringPtr): ComponentResult;
  766.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  767.     INLINE $2F3C, $0008, $0015, $7000, $A82A;
  768.     {$ENDC}
  769. FUNCTION MusicFindTone(mc: MusicComponent; VAR td: ToneDescription; VAR libraryIndexOut: LONGINT; VAR fit: UInt32): ComponentResult;
  770.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  771.     INLINE $2F3C, $000C, $0016, $7000, $A82A;
  772.     {$ENDC}
  773. FUNCTION MusicPlayNote(mc: MusicComponent; part: LONGINT; pitch: LONGINT; velocity: LONGINT): ComponentResult;
  774.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  775.     INLINE $2F3C, $000C, $0017, $7000, $A82A;
  776.     {$ENDC}
  777. FUNCTION MusicResetPart(mc: MusicComponent; part: LONGINT): ComponentResult;
  778.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  779.     INLINE $2F3C, $0004, $0018, $7000, $A82A;
  780.     {$ENDC}
  781. FUNCTION MusicSetPartController(mc: MusicComponent; part: LONGINT; controllerNumber: MusicController; controllerValue: LONGINT): ComponentResult;
  782.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  783.     INLINE $2F3C, $000C, $0019, $7000, $A82A;
  784.     {$ENDC}
  785.  
  786. FUNCTION MusicGetPartController(mc: MusicComponent; part: LONGINT; controllerNumber: MusicController): ComponentResult;
  787.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  788.     INLINE $2F3C, $0008, $001A, $7000, $A82A;
  789.     {$ENDC}
  790. FUNCTION MusicGetMIDIProc(mc: MusicComponent; VAR midiSendProc: MusicMIDISendUPP; VAR refCon: LONGINT): ComponentResult;
  791.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  792.     INLINE $2F3C, $0008, $001B, $7000, $A82A;
  793.     {$ENDC}
  794. FUNCTION MusicSetMIDIProc(mc: MusicComponent; midiSendProc: MusicMIDISendUPP; refCon: LONGINT): ComponentResult;
  795.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  796.     INLINE $2F3C, $0008, $001C, $7000, $A82A;
  797.     {$ENDC}
  798. FUNCTION MusicGetInstrumentNames(mc: MusicComponent; modifiableInstruments: LONGINT; VAR instrumentNames: Handle; VAR instrumentCategoryLasts: Handle; VAR instrumentCategoryNames: Handle): ComponentResult;
  799.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  800.     INLINE $2F3C, $0010, $001D, $7000, $A82A;
  801.     {$ENDC}
  802. FUNCTION MusicGetDrumNames(mc: MusicComponent; modifiableInstruments: LONGINT; VAR instrumentNumbers: Handle; VAR instrumentNames: Handle): ComponentResult;
  803.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  804.     INLINE $2F3C, $000C, $001E, $7000, $A82A;
  805.     {$ENDC}
  806. FUNCTION MusicGetMasterTune(mc: MusicComponent): ComponentResult;
  807.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  808.     INLINE $2F3C, $0000, $001F, $7000, $A82A;
  809.     {$ENDC}
  810. FUNCTION MusicSetMasterTune(mc: MusicComponent; masterTune: LONGINT): ComponentResult;
  811.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  812.     INLINE $2F3C, $0004, $0020, $7000, $A82A;
  813.     {$ENDC}
  814.  
  815. FUNCTION MusicGetInstrumentAboutInfo(mc: MusicComponent; part: LONGINT; VAR iai: InstrumentAboutInfo): ComponentResult;
  816.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  817.     INLINE $2F3C, $0008, $0022, $7000, $A82A;
  818.     {$ENDC}
  819. FUNCTION MusicGetDeviceConnection(mc: MusicComponent; index: LONGINT; VAR id1: LONGINT; VAR id2: LONGINT): ComponentResult;
  820.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  821.     INLINE $2F3C, $000C, $0023, $7000, $A82A;
  822.     {$ENDC}
  823. FUNCTION MusicUseDeviceConnection(mc: MusicComponent; id1: LONGINT; id2: LONGINT): ComponentResult;
  824.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  825.     INLINE $2F3C, $0008, $0024, $7000, $A82A;
  826.     {$ENDC}
  827. FUNCTION MusicGetKnobSettingStrings(mc: MusicComponent; knobIndex: LONGINT; isGlobal: LONGINT; VAR settingsNames: Handle; VAR settingsCategoryLasts: Handle; VAR settingsCategoryNames: Handle): ComponentResult;
  828.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  829.     INLINE $2F3C, $0014, $0025, $7000, $A82A;
  830.     {$ENDC}
  831. FUNCTION MusicGetMIDIPorts(mc: MusicComponent; VAR inputPortCount: LONGINT; VAR outputPortCount: LONGINT): ComponentResult;
  832.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  833.     INLINE $2F3C, $0008, $0026, $7000, $A82A;
  834.     {$ENDC}
  835. FUNCTION MusicSendMIDI(mc: MusicComponent; portIndex: LONGINT; VAR mp: MusicMIDIPacket): ComponentResult;
  836.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  837.     INLINE $2F3C, $0008, $0027, $7000, $A82A;
  838.     {$ENDC}
  839. FUNCTION MusicReceiveMIDI(mc: MusicComponent; readHook: MusicMIDIReadHookUPP; refCon: LONGINT): ComponentResult;
  840.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  841.     INLINE $2F3C, $0008, $0028, $7000, $A82A;
  842.     {$ENDC}
  843. FUNCTION MusicStartOffline(mc: MusicComponent; VAR numChannels: UInt32; VAR sampleRate: UnsignedFixed; VAR sampleSize: UInt16; dataProc: MusicOfflineDataUPP; dataProcRefCon: LONGINT): ComponentResult;
  844.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  845.     INLINE $2F3C, $0014, $0029, $7000, $A82A;
  846.     {$ENDC}
  847. FUNCTION MusicSetOfflineTimeTo(mc: MusicComponent; newTimeStamp: LONGINT): ComponentResult;
  848.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  849.     INLINE $2F3C, $0004, $002A, $7000, $A82A;
  850.     {$ENDC}
  851. FUNCTION MusicGetInstrumentKnobDescription(mc: MusicComponent; knobIndex: LONGINT; VAR mkd: KnobDescription): ComponentResult;
  852.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  853.     INLINE $2F3C, $0008, $002B, $7000, $A82A;
  854.     {$ENDC}
  855. FUNCTION MusicGetDrumKnobDescription(mc: MusicComponent; knobIndex: LONGINT; VAR mkd: KnobDescription): ComponentResult;
  856.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  857.     INLINE $2F3C, $0008, $002C, $7000, $A82A;
  858.     {$ENDC}
  859. FUNCTION MusicGetKnobDescription(mc: MusicComponent; knobIndex: LONGINT; VAR mkd: KnobDescription): ComponentResult;
  860.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  861.     INLINE $2F3C, $0008, $002D, $7000, $A82A;
  862.     {$ENDC}
  863. FUNCTION MusicGetInfoText(mc: MusicComponent; selector: LONGINT; VAR textH: Handle; VAR styleH: Handle): ComponentResult;
  864.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  865.     INLINE $2F3C, $000C, $002E, $7000, $A82A;
  866.     {$ENDC}
  867.  
  868. CONST
  869.     kGetInstrumentInfoNoBuiltIn    = $01;
  870.     kGetInstrumentInfoMidiUserInst = $02;
  871.     kGetInstrumentInfoNoIText    = $04;
  872.  
  873. FUNCTION MusicGetInstrumentInfo(mc: MusicComponent; getInstrumentInfoFlags: LONGINT; VAR infoListH: InstrumentInfoListHandle): ComponentResult;
  874.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  875.     INLINE $2F3C, $0008, $002F, $7000, $A82A;
  876.     {$ENDC}
  877.  
  878.  
  879.  
  880. FUNCTION MusicTask(mc: MusicComponent): ComponentResult;
  881.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  882.     INLINE $2F3C, $0000, $0031, $7000, $A82A;
  883.     {$ENDC}
  884. FUNCTION MusicSetPartInstrumentNumberInterruptSafe(mc: MusicComponent; part: LONGINT; instrumentNumber: LONGINT): ComponentResult;
  885.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  886.     INLINE $2F3C, $0008, $0032, $7000, $A82A;
  887.     {$ENDC}
  888. FUNCTION MusicSetPartSoundLocalization(mc: MusicComponent; part: LONGINT; data: Handle): ComponentResult;
  889.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  890.     INLINE $2F3C, $0008, $0033, $7000, $A82A;
  891.     {$ENDC}
  892. FUNCTION MusicGenericConfigure(mc: MusicComponent; mode: LONGINT; flags: LONGINT; baseResID: LONGINT): ComponentResult;
  893.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  894.     INLINE $2F3C, $000C, $0100, $7000, $A82A;
  895.     {$ENDC}
  896. FUNCTION MusicGenericGetPart(mc: MusicComponent; partNumber: LONGINT; VAR part: GCPartPtr): ComponentResult;
  897.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  898.     INLINE $2F3C, $0008, $0101, $7000, $A82A;
  899.     {$ENDC}
  900. FUNCTION MusicGenericGetKnobList(mc: MusicComponent; knobType: LONGINT; VAR gkdlH: GenericKnobDescriptionListHandle): ComponentResult;
  901.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  902.     INLINE $2F3C, $0008, $0102, $7000, $A82A;
  903.     {$ENDC}
  904. FUNCTION MusicGenericSetResourceNumbers(mc: MusicComponent; resourceIDH: Handle): ComponentResult;
  905.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  906.     INLINE $2F3C, $0004, $0103, $7000, $A82A;
  907.     {$ENDC}
  908. FUNCTION MusicDerivedMIDISend(mc: MusicComponent; VAR packet: MusicMIDIPacket): ComponentResult;
  909.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  910.     INLINE $2F3C, $0004, $0200, $7000, $A82A;
  911.     {$ENDC}
  912. FUNCTION MusicDerivedSetKnob(mc: MusicComponent; knobType: LONGINT; knobNumber: LONGINT; knobValue: LONGINT; partNumber: LONGINT; VAR p: GCPart; VAR gkd: GenericKnobDescription): ComponentResult;
  913.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  914.     INLINE $2F3C, $0018, $0201, $7000, $A82A;
  915.     {$ENDC}
  916. FUNCTION MusicDerivedSetPart(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart): ComponentResult;
  917.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  918.     INLINE $2F3C, $0008, $0202, $7000, $A82A;
  919.     {$ENDC}
  920. FUNCTION MusicDerivedSetInstrument(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart): ComponentResult;
  921.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  922.     INLINE $2F3C, $0008, $0203, $7000, $A82A;
  923.     {$ENDC}
  924. FUNCTION MusicDerivedSetPartInstrumentNumber(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart): ComponentResult;
  925.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  926.     INLINE $2F3C, $0008, $0204, $7000, $A82A;
  927.     {$ENDC}
  928. FUNCTION MusicDerivedSetMIDI(mc: MusicComponent; midiProc: MusicMIDISendUPP; refcon: LONGINT; midiChannel: LONGINT): ComponentResult;
  929.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  930.     INLINE $2F3C, $000C, $0205, $7000, $A82A;
  931.     {$ENDC}
  932. FUNCTION MusicDerivedStorePartInstrument(mc: MusicComponent; partNumber: LONGINT; VAR p: GCPart; instrumentNumber: LONGINT): ComponentResult;
  933.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  934.     INLINE $2F3C, $000C, $0206, $7000, $A82A;
  935.     {$ENDC}
  936. FUNCTION MusicDerivedOpenResFile(mc: MusicComponent): ComponentResult;
  937.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  938.     INLINE $2F3C, $0000, $0207, $7000, $A82A;
  939.     {$ENDC}
  940. FUNCTION MusicDerivedCloseResFile(mc: MusicComponent; resRefNum: INTEGER): ComponentResult;
  941.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  942.     INLINE $2F3C, $0002, $0208, $7000, $A82A;
  943.     {$ENDC}
  944.  
  945.  
  946.  
  947.  
  948.  
  949. {  Mask bit for returned value by InstrumentFind. }
  950.  
  951. CONST
  952.     kInstrumentExactMatch        = $00020000;
  953.     kInstrumentRecommendedSubstitute = $00010000;
  954.     kInstrumentQualityField        = $FF000000;
  955.     kInstrumentRoland8BitQuality = $05000000;
  956.  
  957.  
  958. TYPE
  959.     InstrumentAboutInfoHandle            = ^InstrumentAboutInfoPtr;
  960.     GMInstrumentInfoPtr = ^GMInstrumentInfo;
  961.     GMInstrumentInfo = RECORD
  962.         cmpInstID:                LONGINT;
  963.         gmInstNum:                LONGINT;
  964.         instMatch:                LONGINT;
  965.     END;
  966.  
  967.     GMInstrumentInfoHandle                = ^GMInstrumentInfoPtr;
  968.     nonGMInstrumentInfoRecordPtr = ^nonGMInstrumentInfoRecord;
  969.     nonGMInstrumentInfoRecord = RECORD
  970.         cmpInstID:                LONGINT;                                {  if 0, category name }
  971.         flags:                    LONGINT;                                {  match, show in picker }
  972.         toneNameIndex:            LONGINT;                                {  index in toneNames (1 based) }
  973.         itxtNameAtomID:            LONGINT;                                {  index in itxtNames (itxt/name by index) }
  974.     END;
  975.  
  976.     nonGMInstrumentInfoPtr = ^nonGMInstrumentInfo;
  977.     nonGMInstrumentInfo = RECORD
  978.         recordCount:            LONGINT;
  979.         toneNames:                Handle;                                    {  name from tone description }
  980.         itxtNames:                QTAtomContainer;                        {  itext/name atoms for instruments }
  981.         instInfo:                ARRAY [0..0] OF nonGMInstrumentInfoRecord;
  982.     END;
  983.  
  984.     nonGMInstrumentInfoHandle            = ^nonGMInstrumentInfoPtr;
  985.     InstCompInfoPtr = ^InstCompInfo;
  986.     InstCompInfo = RECORD
  987.         infoSize:                LONGINT;                                {  size of this record }
  988.         InstrumentLibraryName:    Str31;
  989.         InstrumentLibraryITxt:    QTAtomContainer;                        {  itext/name atoms for instruments }
  990.         GMinstrumentCount:        LONGINT;
  991.         GMinstrumentInfo:        GMInstrumentInfoHandle;
  992.         GMdrumCount:            LONGINT;
  993.         GMdrumInfo:                GMInstrumentInfoHandle;
  994.         nonGMinstrumentCount:    LONGINT;
  995.         nonGMinstrumentInfo:    nonGMInstrumentInfoHandle;
  996.     END;
  997.  
  998.     InstCompInfoHandle                    = ^InstCompInfoPtr;
  999. FUNCTION InstrumentGetInst(ci: ComponentInstance; instID: LONGINT; VAR atomicInst: AtomicInstrument; flags: LONGINT): ComponentResult;
  1000.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1001.     INLINE $2F3C, $000C, $0001, $7000, $A82A;
  1002.     {$ENDC}
  1003. FUNCTION InstrumentGetInfo(ci: ComponentInstance; getInstrumentInfoFlags: LONGINT; VAR instInfo: InstCompInfoHandle): ComponentResult;
  1004.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1005.     INLINE $2F3C, $0008, $0002, $7000, $A82A;
  1006.     {$ENDC}
  1007. FUNCTION InstrumentInitialize(ci: ComponentInstance; initFormat: LONGINT; initParams: UNIV Ptr): ComponentResult;
  1008.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1009.     INLINE $2F3C, $0008, $0003, $7000, $A82A;
  1010.     {$ENDC}
  1011. FUNCTION InstrumentOpenComponentResFile(ci: ComponentInstance; VAR resFile: INTEGER): ComponentResult;
  1012.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1013.     INLINE $2F3C, $0004, $0004, $7000, $A82A;
  1014.     {$ENDC}
  1015. FUNCTION InstrumentCloseComponentResFile(ci: ComponentInstance; resFile: INTEGER): ComponentResult;
  1016.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1017.     INLINE $2F3C, $0002, $0005, $7000, $A82A;
  1018.     {$ENDC}
  1019. FUNCTION InstrumentGetComponentRefCon(ci: ComponentInstance; VAR refCon: UNIV Ptr): ComponentResult;
  1020.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1021.     INLINE $2F3C, $0004, $0006, $7000, $A82A;
  1022.     {$ENDC}
  1023. FUNCTION InstrumentSetComponentRefCon(ci: ComponentInstance; refCon: UNIV Ptr): ComponentResult;
  1024.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1025.     INLINE $2F3C, $0004, $0007, $7000, $A82A;
  1026.     {$ENDC}
  1027. FUNCTION InstrumentGetSynthesizerType(ci: ComponentInstance; VAR synthesizerType: OSType): ComponentResult;
  1028.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1029.     INLINE $2F3C, $0004, $0008, $7000, $A82A;
  1030.     {$ENDC}
  1031.  
  1032.  
  1033. {--------------------------
  1034.     Types
  1035. --------------------------}
  1036.  
  1037. CONST
  1038.     kNoteRequestNoGM            = 1;                            {  dont degrade to a GM synth  }
  1039.     kNoteRequestNoSynthType        = 2;                            {  dont degrade to another synth of same type but different name  }
  1040.     kNoteRequestSynthMustMatch    = 4;                            {  synthType must be a match, including kGMSynthComponentSubType  }
  1041.  
  1042.  
  1043. TYPE
  1044.     NoteAllocator                        = ComponentInstance;
  1045.     NoteRequestInfoPtr = ^NoteRequestInfo;
  1046.     NoteRequestInfo = RECORD
  1047.         flags:                    SInt8;                                    {  1: dont accept GM match, 2: dont accept same-synth-type match  }
  1048.         reserved:                SInt8;                                    {  must be zero  }
  1049.         polyphony:                BigEndianShort;                            {  Maximum number of voices  }
  1050.         typicalPolyphony:        BigEndianFixed;                            {  Hint for level mixing  }
  1051.     END;
  1052.  
  1053.     NoteRequestPtr = ^NoteRequest;
  1054.     NoteRequest = RECORD
  1055.         info:                    NoteRequestInfo;
  1056.         tone:                    ToneDescription;
  1057.     END;
  1058.  
  1059.     NoteChannel = ^LONGINT;
  1060.  
  1061.  
  1062.  
  1063. CONST
  1064.     kPickDontMix                = 1;                            {  dont mix instruments with drum sounds  }
  1065.     kPickSameSynth                = 2;                            {  only allow the same device that went in, to come out  }
  1066.     kPickUserInsts                = 4;                            {  show user insts in addition to ROM voices  }
  1067.     kPickEditAllowEdit            = 8;                            {  lets user switch over to edit mode  }
  1068.     kPickEditAllowPick            = 16;                            {  lets the user switch over to pick mode  }
  1069.     kPickEditSynthGlobal        = 32;                            {  edit the global knobs of the synth  }
  1070.     kPickEditControllers        = 64;                            {  edit the controllers of the notechannel  }
  1071.  
  1072.  
  1073.     kNoteAllocatorComponentType    = 'nota';
  1074.  
  1075.  
  1076. {--------------------------------
  1077.     Note Allocator Prototypes
  1078. --------------------------------}
  1079. FUNCTION NARegisterMusicDevice(na: NoteAllocator; synthType: OSType; VAR name: Str31; VAR connections: SynthesizerConnections): ComponentResult;
  1080.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1081.     INLINE $2F3C, $000C, $0000, $7000, $A82A;
  1082.     {$ENDC}
  1083. FUNCTION NAUnregisterMusicDevice(na: NoteAllocator; index: LONGINT): ComponentResult;
  1084.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1085.     INLINE $2F3C, $0004, $0001, $7000, $A82A;
  1086.     {$ENDC}
  1087. FUNCTION NAGetRegisteredMusicDevice(na: NoteAllocator; index: LONGINT; VAR synthType: OSType; VAR name: Str31; VAR connections: SynthesizerConnections; VAR mc: MusicComponent): ComponentResult;
  1088.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1089.     INLINE $2F3C, $0014, $0002, $7000, $A82A;
  1090.     {$ENDC}
  1091. FUNCTION NASaveMusicConfiguration(na: NoteAllocator): ComponentResult;
  1092.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1093.     INLINE $2F3C, $0000, $0003, $7000, $A82A;
  1094.     {$ENDC}
  1095. FUNCTION NANewNoteChannel(na: NoteAllocator; VAR noteRequest: NoteRequest; VAR outChannel: NoteChannel): ComponentResult;
  1096.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1097.     INLINE $2F3C, $0008, $0004, $7000, $A82A;
  1098.     {$ENDC}
  1099. FUNCTION NADisposeNoteChannel(na: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
  1100.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1101.     INLINE $2F3C, $0004, $0005, $7000, $A82A;
  1102.     {$ENDC}
  1103. FUNCTION NAGetNoteChannelInfo(na: NoteAllocator; noteChannel: NoteChannel; VAR index: LONGINT; VAR part: LONGINT): ComponentResult;
  1104.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1105.     INLINE $2F3C, $000C, $0006, $7000, $A82A;
  1106.     {$ENDC}
  1107. FUNCTION NAPrerollNoteChannel(na: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
  1108.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1109.     INLINE $2F3C, $0004, $0007, $7000, $A82A;
  1110.     {$ENDC}
  1111. FUNCTION NAUnrollNoteChannel(na: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
  1112.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1113.     INLINE $2F3C, $0004, $0008, $7000, $A82A;
  1114.     {$ENDC}
  1115.  
  1116. FUNCTION NASetNoteChannelVolume(na: NoteAllocator; noteChannel: NoteChannel; volume: Fixed): ComponentResult;
  1117.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1118.     INLINE $2F3C, $0008, $000B, $7000, $A82A;
  1119.     {$ENDC}
  1120. FUNCTION NAResetNoteChannel(na: NoteAllocator; noteChannel: NoteChannel): ComponentResult;
  1121.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1122.     INLINE $2F3C, $0004, $000C, $7000, $A82A;
  1123.     {$ENDC}
  1124. FUNCTION NAPlayNote(na: NoteAllocator; noteChannel: NoteChannel; pitch: LONGINT; velocity: LONGINT): ComponentResult;
  1125.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1126.     INLINE $2F3C, $000C, $000D, $7000, $A82A;
  1127.     {$ENDC}
  1128. FUNCTION NASetController(na: NoteAllocator; noteChannel: NoteChannel; controllerNumber: LONGINT; controllerValue: LONGINT): ComponentResult;
  1129.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1130.     INLINE $2F3C, $000C, $000E, $7000, $A82A;
  1131.     {$ENDC}
  1132. FUNCTION NASetKnob(na: NoteAllocator; noteChannel: NoteChannel; knobNumber: LONGINT; knobValue: LONGINT): ComponentResult;
  1133.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1134.     INLINE $2F3C, $000C, $000F, $7000, $A82A;
  1135.     {$ENDC}
  1136. FUNCTION NAFindNoteChannelTone(na: NoteAllocator; noteChannel: NoteChannel; VAR td: ToneDescription; VAR instrumentNumber: LONGINT): ComponentResult;
  1137.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1138.     INLINE $2F3C, $000C, $0010, $7000, $A82A;
  1139.     {$ENDC}
  1140. FUNCTION NASetInstrumentNumber(na: NoteAllocator; noteChannel: NoteChannel; instrumentNumber: LONGINT): ComponentResult;
  1141.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1142.     INLINE $2F3C, $0008, $0011, $7000, $A82A;
  1143.     {$ENDC}
  1144.  
  1145.  
  1146. FUNCTION NAPickInstrument(na: NoteAllocator; filterProc: ModalFilterUPP; prompt: StringPtr; VAR sd: ToneDescription; flags: UInt32; refCon: LONGINT; reserved1: LONGINT; reserved2: LONGINT): ComponentResult;
  1147.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1148.     INLINE $2F3C, $001C, $0012, $7000, $A82A;
  1149.     {$ENDC}
  1150. FUNCTION NAPickArrangement(na: NoteAllocator; filterProc: ModalFilterUPP; prompt: StringPtr; zero1: LONGINT; zero2: LONGINT; t: Track; songName: StringPtr): ComponentResult;
  1151.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1152.     INLINE $2F3C, $0018, $0013, $7000, $A82A;
  1153.     {$ENDC}
  1154.  
  1155. FUNCTION NASetDefaultMIDIInput(na: NoteAllocator; VAR sc: SynthesizerConnections): ComponentResult;
  1156.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1157.     INLINE $2F3C, $0004, $0015, $7000, $A82A;
  1158.     {$ENDC}
  1159. FUNCTION NAGetDefaultMIDIInput(na: NoteAllocator; VAR sc: SynthesizerConnections): ComponentResult;
  1160.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1161.     INLINE $2F3C, $0004, $0016, $7000, $A82A;
  1162.     {$ENDC}
  1163.  
  1164. FUNCTION NAUseDefaultMIDIInput(na: NoteAllocator; readHook: MusicMIDIReadHookUPP; refCon: LONGINT; flags: UInt32): ComponentResult;
  1165.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1166.     INLINE $2F3C, $000C, $0019, $7000, $A82A;
  1167.     {$ENDC}
  1168. FUNCTION NALoseDefaultMIDIInput(na: NoteAllocator): ComponentResult;
  1169.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1170.     INLINE $2F3C, $0000, $001A, $7000, $A82A;
  1171.     {$ENDC}
  1172. FUNCTION NAStuffToneDescription(na: NoteAllocator; gmNumber: LONGINT; VAR td: ToneDescription): ComponentResult;
  1173.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1174.     INLINE $2F3C, $0008, $001B, $7000, $A82A;
  1175.     {$ENDC}
  1176. FUNCTION NACopyrightDialog(na: NoteAllocator; p: PicHandle; author: StringPtr; copyright: StringPtr; other: StringPtr; title: StringPtr; filterProc: ModalFilterUPP; refCon: LONGINT): ComponentResult;
  1177.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1178.     INLINE $2F3C, $001C, $001C, $7000, $A82A;
  1179.     {$ENDC}
  1180.  
  1181. {
  1182.       kNADummyOneSelect = 29
  1183.       kNADummyTwoSelect = 30
  1184. }
  1185.  
  1186. FUNCTION NAGetIndNoteChannel(na: NoteAllocator; index: LONGINT; VAR nc: NoteChannel; VAR seed: LONGINT): ComponentResult;
  1187.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1188.     INLINE $2F3C, $000C, $001F, $7000, $A82A;
  1189.     {$ENDC}
  1190.  
  1191. FUNCTION NAGetMIDIPorts(na: NoteAllocator; VAR inputPorts: QTMIDIPortListHandle; VAR outputPorts: QTMIDIPortListHandle): ComponentResult;
  1192.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1193.     INLINE $2F3C, $0008, $0021, $7000, $A82A;
  1194.     {$ENDC}
  1195. FUNCTION NAGetNoteRequest(na: NoteAllocator; noteChannel: NoteChannel; VAR nrOut: NoteRequest): ComponentResult;
  1196.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1197.     INLINE $2F3C, $0008, $0022, $7000, $A82A;
  1198.     {$ENDC}
  1199. FUNCTION NASendMIDI(na: NoteAllocator; noteChannel: NoteChannel; VAR mp: MusicMIDIPacket): ComponentResult;
  1200.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1201.     INLINE $2F3C, $0008, $0023, $7000, $A82A;
  1202.     {$ENDC}
  1203. FUNCTION NAPickEditInstrument(na: NoteAllocator; filterProc: ModalFilterUPP; prompt: StringPtr; refCon: LONGINT; nc: NoteChannel; ai: AtomicInstrument; flags: LONGINT): ComponentResult;
  1204.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1205.     INLINE $2F3C, $0018, $0024, $7000, $A82A;
  1206.     {$ENDC}
  1207. FUNCTION NANewNoteChannelFromAtomicInstrument(na: NoteAllocator; instrument: AtomicInstrumentPtr; flags: LONGINT; VAR outChannel: NoteChannel): ComponentResult;
  1208.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1209.     INLINE $2F3C, $000C, $0025, $7000, $A82A;
  1210.     {$ENDC}
  1211. FUNCTION NASetAtomicInstrument(na: NoteAllocator; noteChannel: NoteChannel; instrument: AtomicInstrumentPtr; flags: LONGINT): ComponentResult;
  1212.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1213.     INLINE $2F3C, $000C, $0026, $7000, $A82A;
  1214.     {$ENDC}
  1215.  
  1216.  
  1217. FUNCTION NAGetKnob(na: NoteAllocator; noteChannel: NoteChannel; knobNumber: LONGINT; VAR knobValue: LONGINT): ComponentResult;
  1218.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1219.     INLINE $2F3C, $000C, $0028, $7000, $A82A;
  1220.     {$ENDC}
  1221. FUNCTION NATask(na: NoteAllocator): ComponentResult;
  1222.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1223.     INLINE $2F3C, $0000, $0029, $7000, $A82A;
  1224.     {$ENDC}
  1225. FUNCTION NASetNoteChannelBalance(na: NoteAllocator; noteChannel: NoteChannel; balance: LONGINT): ComponentResult;
  1226.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1227.     INLINE $2F3C, $0008, $002A, $7000, $A82A;
  1228.     {$ENDC}
  1229. FUNCTION NASetInstrumentNumberInterruptSafe(na: NoteAllocator; noteChannel: NoteChannel; instrumentNumber: LONGINT): ComponentResult;
  1230.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1231.     INLINE $2F3C, $0008, $002B, $7000, $A82A;
  1232.     {$ENDC}
  1233. FUNCTION NASetNoteChannelSoundLocalization(na: NoteAllocator; noteChannel: NoteChannel; data: Handle): ComponentResult;
  1234.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1235.     INLINE $2F3C, $0008, $002C, $7000, $A82A;
  1236.     {$ENDC}
  1237. FUNCTION NAGetController(na: NoteAllocator; noteChannel: NoteChannel; controllerNumber: LONGINT; VAR controllerValue: LONGINT): ComponentResult;
  1238.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1239.     INLINE $2F3C, $000C, $002D, $7000, $A82A;
  1240.     {$ENDC}
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246. CONST
  1247.     kTuneQueueDepth                = 8;                            {  Deepest you can queue tune segments  }
  1248.  
  1249.  
  1250.  
  1251. TYPE
  1252.     TuneStatusPtr = ^TuneStatus;
  1253.     TuneStatus = RECORD
  1254.         tune:                    LongintPtr;                                {  currently playing tune  }
  1255.         tunePtr:                LongintPtr;                                {  position within currently playing piece  }
  1256.         time:                    TimeValue;                                {  current tune time  }
  1257.         queueCount:                INTEGER;                                {  how many pieces queued up?  }
  1258.         queueSpots:                INTEGER;                                {  How many more tunepieces can be queued  }
  1259.         queueTime:                TimeValue;                                {  How much time is queued up? (can be very inaccurate)  }
  1260.         reserved:                ARRAY [0..2] OF LONGINT;
  1261.     END;
  1262.  
  1263. {$IFC TYPED_FUNCTION_POINTERS}
  1264.     TuneCallBackProcPtr = PROCEDURE({CONST}VAR status: TuneStatus; refCon: LONGINT);
  1265. {$ELSEC}
  1266.     TuneCallBackProcPtr = ProcPtr;
  1267. {$ENDC}
  1268.  
  1269. {$IFC TYPED_FUNCTION_POINTERS}
  1270.     TunePlayCallBackProcPtr = PROCEDURE(VAR event: UInt32; seed: LONGINT; refCon: LONGINT);
  1271. {$ELSEC}
  1272.     TunePlayCallBackProcPtr = ProcPtr;
  1273. {$ENDC}
  1274.  
  1275.     TuneCallBackUPP = UniversalProcPtr;
  1276.     TunePlayCallBackUPP = UniversalProcPtr;
  1277.     TunePlayer                            = ComponentInstance;
  1278.  
  1279. CONST
  1280.     kTunePlayerComponentType    = 'tune';
  1281.  
  1282.  
  1283. FUNCTION TuneSetHeader(tp: TunePlayer; VAR header: UInt32): ComponentResult;
  1284.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1285.     INLINE $2F3C, $0004, $0004, $7000, $A82A;
  1286.     {$ENDC}
  1287. FUNCTION TuneGetTimeBase(tp: TunePlayer; VAR tb: TimeBase): ComponentResult;
  1288.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1289.     INLINE $2F3C, $0004, $0005, $7000, $A82A;
  1290.     {$ENDC}
  1291. FUNCTION TuneSetTimeScale(tp: TunePlayer; scale: TimeScale): ComponentResult;
  1292.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1293.     INLINE $2F3C, $0004, $0006, $7000, $A82A;
  1294.     {$ENDC}
  1295. FUNCTION TuneGetTimeScale(tp: TunePlayer; VAR scale: TimeScale): ComponentResult;
  1296.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1297.     INLINE $2F3C, $0004, $0007, $7000, $A82A;
  1298.     {$ENDC}
  1299. FUNCTION TuneGetIndexedNoteChannel(tp: TunePlayer; i: LONGINT; VAR nc: NoteChannel): ComponentResult;
  1300.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1301.     INLINE $2F3C, $0008, $0008, $7000, $A82A;
  1302.     {$ENDC}
  1303.  
  1304. { Values for when to start. }
  1305.  
  1306. CONST
  1307.     kTuneStartNow                = 1;                            {  start after buffer is implied  }
  1308.     kTuneDontClipNotes            = 2;                            {  allow notes to finish their durations outside sample  }
  1309.     kTuneExcludeEdgeNotes        = 4;                            {  dont play notes that start at end of tune  }
  1310.     kTuneQuickStart                = 8;                            {  Leave all the controllers where they are, ignore start time  }
  1311.     kTuneLoopUntil                = 16;                            {  loop a queued tune if there's nothing else in the queue }
  1312.     kTunePlayDifference            = 32;                            {  by default, the tune difference is skipped }
  1313.     kTunePlayConcurrent            = 64;                            {  dont block the next tune sequence with this one }
  1314.     kTuneStartNewMaster            = 16384;
  1315.  
  1316. FUNCTION TuneQueue(tp: TunePlayer; VAR tune: UInt32; tuneRate: Fixed; tuneStartPosition: UInt32; tuneStopPosition: UInt32; queueFlags: UInt32; callBackProc: TuneCallBackUPP; refCon: LONGINT): ComponentResult;
  1317.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1318.     INLINE $2F3C, $001C, $000A, $7000, $A82A;
  1319.     {$ENDC}
  1320. FUNCTION TuneInstant(tp: TunePlayer; VAR tune: UInt32; tunePosition: UInt32): ComponentResult;
  1321.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1322.     INLINE $2F3C, $0008, $000B, $7000, $A82A;
  1323.     {$ENDC}
  1324. FUNCTION TuneGetStatus(tp: TunePlayer; VAR status: TuneStatus): ComponentResult;
  1325.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1326.     INLINE $2F3C, $0004, $000C, $7000, $A82A;
  1327.     {$ENDC}
  1328. { Values for stopping. }
  1329.  
  1330. CONST
  1331.     kTuneStopFade                = 1;                            {  do a quick, synchronous fadeout  }
  1332.     kTuneStopSustain            = 2;                            {  don't silece notes  }
  1333.     kTuneStopInstant            = 4;                            {  silence notes fast (else, decay them)  }
  1334.     kTuneStopReleaseChannels    = 8;                            {  afterwards, let the channels go  }
  1335.  
  1336. FUNCTION TuneStop(tp: TunePlayer; stopFlags: LONGINT): ComponentResult;
  1337.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1338.     INLINE $2F3C, $0004, $000D, $7000, $A82A;
  1339.     {$ENDC}
  1340.  
  1341. FUNCTION TuneSetVolume(tp: TunePlayer; volume: Fixed): ComponentResult;
  1342.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1343.     INLINE $2F3C, $0004, $0010, $7000, $A82A;
  1344.     {$ENDC}
  1345. FUNCTION TuneGetVolume(tp: TunePlayer): ComponentResult;
  1346.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1347.     INLINE $2F3C, $0000, $0011, $7000, $A82A;
  1348.     {$ENDC}
  1349. FUNCTION TunePreroll(tp: TunePlayer): ComponentResult;
  1350.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1351.     INLINE $2F3C, $0000, $0012, $7000, $A82A;
  1352.     {$ENDC}
  1353. FUNCTION TuneUnroll(tp: TunePlayer): ComponentResult;
  1354.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1355.     INLINE $2F3C, $0000, $0013, $7000, $A82A;
  1356.     {$ENDC}
  1357. FUNCTION TuneSetNoteChannels(tp: TunePlayer; count: UInt32; VAR noteChannelList: NoteChannel; playCallBackProc: TunePlayCallBackUPP; refCon: LONGINT): ComponentResult;
  1358.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1359.     INLINE $2F3C, $0010, $0014, $7000, $A82A;
  1360.     {$ENDC}
  1361. FUNCTION TuneSetPartTranspose(tp: TunePlayer; part: UInt32; transpose: LONGINT; velocityShift: LONGINT): ComponentResult;
  1362.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1363.     INLINE $2F3C, $000C, $0015, $7000, $A82A;
  1364.     {$ENDC}
  1365.  
  1366. FUNCTION TuneGetNoteAllocator(tp: TunePlayer): NoteAllocator;
  1367.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1368.     INLINE $2F3C, $0000, $0017, $7000, $A82A;
  1369.     {$ENDC}
  1370. FUNCTION TuneSetSofter(tp: TunePlayer; softer: LONGINT): ComponentResult;
  1371.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1372.     INLINE $2F3C, $0004, $0018, $7000, $A82A;
  1373.     {$ENDC}
  1374. FUNCTION TuneTask(tp: TunePlayer): ComponentResult;
  1375.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1376.     INLINE $2F3C, $0000, $0019, $7000, $A82A;
  1377.     {$ENDC}
  1378. FUNCTION TuneSetBalance(tp: TunePlayer; balance: LONGINT): ComponentResult;
  1379.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1380.     INLINE $2F3C, $0004, $001A, $7000, $A82A;
  1381.     {$ENDC}
  1382. FUNCTION TuneSetSoundLocalization(tp: TunePlayer; data: Handle): ComponentResult;
  1383.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1384.     INLINE $2F3C, $0004, $001B, $7000, $A82A;
  1385.     {$ENDC}
  1386. FUNCTION TuneSetHeaderWithSize(tp: TunePlayer; VAR header: UInt32; size: UInt32): ComponentResult;
  1387.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1388.     INLINE $2F3C, $0008, $001C, $7000, $A82A;
  1389.     {$ENDC}
  1390. { flags for part mix. }
  1391.  
  1392. CONST
  1393.     kTuneMixMute                = 1;                            {  disable a part  }
  1394.     kTuneMixSolo                = 2;                            {  if any parts soloed, play only soloed parts  }
  1395.  
  1396.  
  1397. FUNCTION TuneSetPartMix(tp: TunePlayer; partNumber: UInt32; volume: LONGINT; balance: LONGINT; mixFlags: LONGINT): ComponentResult;
  1398.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1399.     INLINE $2F3C, $0010, $001D, $7000, $A82A;
  1400.     {$ENDC}
  1401. FUNCTION TuneGetPartMix(tp: TunePlayer; partNumber: UInt32; VAR volumeOut: LONGINT; VAR balanceOut: LONGINT; VAR mixFlagsOut: LONGINT): ComponentResult;
  1402.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1403.     INLINE $2F3C, $0010, $001E, $7000, $A82A;
  1404.     {$ENDC}
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410. TYPE
  1411.     MusicOpWord                            = UInt32;
  1412.     MusicOpWordPtr                        = ^UInt32;
  1413. {     QuickTime Music Track Event Formats:
  1414.  
  1415.     At this time, QuickTime music tracks support 5 different event types -- REST events,
  1416.     short NOTE events, short CONTROL events, short GENERAL events, Long NOTE events, 
  1417.     long CONTROL events, and variable GENERAL events.
  1418.  
  1419.         • REST Event (4 bytes/event):
  1420.     
  1421.             (0 0 0) (5-bit UNUSED) (24-bit Rest Duration)
  1422.         
  1423.         • Short NOTE Events (4 bytes/event):
  1424.     
  1425.             (0 0 1) (5-bit Part) (6-bit Pitch) (7-bit Volume) (11-bit Duration)
  1426.         
  1427.             where:    Pitch is offset by 32 (Actual pitch = pitch field + 32)
  1428.  
  1429.         • Short CONTROL Events (4 bytes/event):
  1430.     
  1431.             (0 1 0) (5-bit Part) (8-bit Controller) (1-bit UNUSED) (1-bit Sign) (7-bit MSB) (7-bit LSB)
  1432.                                                                          ( or 15-bit Signed Value)
  1433.         • Short GENERAL Event (4 bytes/event):
  1434.     
  1435.             (0 1 1) (1-bit UNUSED) (12-bit Sub-Type) (16-bit Value)
  1436.     
  1437.         • Long NOTE Events (8 bytes/event):
  1438.     
  1439.             (1 0 0 1) (12-bit Part) (1-bit UNUSED) (7-bit Pitch) (1-bit UNUSED) (7-bit Volume)
  1440.             (1 0) (8-bit UNUSED) (22-bit Duration)
  1441.         
  1442.         • Long CONTROL Event (8 bytes/event):
  1443.         
  1444.             (1 0 1 0) (12-bit Part) (16-bit Value MSB) 
  1445.             (1 0) (14-bit Controller) (16-bit Value LSB)
  1446.     
  1447.         • Long KNOB Event (8 bytes/event):
  1448.     
  1449.             (1 0 1 1) (12-bit Sub-Type) (16-bit Value MSB)
  1450.             (1 0) (14-bit KNOB) (16-bit Value LSB)
  1451.     
  1452.         • Variable GENERAL Length Events (N bytes/event):
  1453.     
  1454.             (1 1 1 1) (12-bit Sub-Type) (16-bit Length)
  1455.                 :
  1456.             (32-bit Data values)
  1457.                 :
  1458.             (1 1) (14-bit UNUSED) (16-bit Length)
  1459.     
  1460.             where:    Length field is the number of LONG words in the record.
  1461.                     Lengths include the first and last long words (Minimum length = 2)
  1462.                 
  1463.     The following event type values have not been used yet and are reserved for 
  1464.     future expansion:
  1465.         
  1466.         • (1 0 0 0)        (8 bytes/event)
  1467.         • (1 1 0 0)        (N bytes/event)
  1468.         • (1 1 0 1)        (N bytes/event)
  1469.         • (1 1 1 0)        (N bytes/event)
  1470.         
  1471.     For all events, the following generalizations apply:
  1472.     
  1473.         -    All duration values are specified in Millisecond units.
  1474.         -     Pitch values are intended to map directly to the MIDI key numbers.
  1475.         -    Controllers from 0 to 127 correspond to the standard MIDI controllers.
  1476.             Controllers greater than 127 correspond to other controls (i.e., Pitch Bend, 
  1477.             Key Pressure, and Channel Pressure).    
  1478. }
  1479.  
  1480. {  Defines for the implemented music event data fields }
  1481.  
  1482. CONST
  1483.     kRestEventType                = $00000000;                    {  lower 3-bits  }
  1484.     kNoteEventType                = $00000001;                    {  lower 3-bits  }
  1485.     kControlEventType            = $00000002;                    {  lower 3-bits  }
  1486.     kMarkerEventType            = $00000003;                    {  lower 3-bits  }
  1487.     kUndefined1EventType        = $00000008;                    {  4-bits  }
  1488.     kXNoteEventType                = $00000009;                    {  4-bits  }
  1489.     kXControlEventType            = $0000000A;                    {  4-bits  }
  1490.     kKnobEventType                = $0000000B;                    {  4-bits  }
  1491.     kUndefined2EventType        = $0000000C;                    {  4-bits  }
  1492.     kUndefined3EventType        = $0000000D;                    {  4-bits  }
  1493.     kUndefined4EventType        = $0000000E;                    {  4-bits  }
  1494.     kGeneralEventType            = $0000000F;                    {  4-bits  }
  1495.     kXEventLengthBits            = $00000002;                    {  2 bits: indicates 8-byte event record  }
  1496.     kGeneralEventLengthBits        = $00000003;                    {  2 bits: indicates variable length event record  }
  1497.     kEventLen                    = 1;                            {  length of events in long words  }
  1498.     kXEventLen                    = 2;
  1499.     kRestEventLen                = 1;                            {  length of events in long words  }
  1500.     kNoteEventLen                = 1;
  1501.     kControlEventLen            = 1;
  1502.     kMarkerEventLen                = 1;
  1503.     kXNoteEventLen                = 2;
  1504.     kXControlEventLen            = 2;
  1505.     kGeneralEventLen            = 2;                            {  2 or more, however  }
  1506.                                                                 {  Universal Event Defines }
  1507.     kEventLengthFieldPos        = 30;                            {  by looking at these two bits of the 1st or last word               }
  1508.     kEventLengthFieldWidth        = 2;                            {  of an event you can determine the event length                       }
  1509.                                                                 {  length field: 0 & 1 => 1 long; 2 => 2 longs; 3 => variable length  }
  1510.     kEventTypeFieldPos            = 29;                            {  event type field for short events  }
  1511.     kEventTypeFieldWidth        = 3;                            {  short type is 3 bits  }
  1512.     kXEventTypeFieldPos            = 28;                            {  event type field for extended events  }
  1513.     kXEventTypeFieldWidth        = 4;                            {  extended type is 4 bits  }
  1514.     kEventPartFieldPos            = 24;
  1515.     kEventPartFieldWidth        = 5;
  1516.     kXEventPartFieldPos            = 16;                            {  in the 1st long word  }
  1517.     kXEventPartFieldWidth        = 12;                            {  Rest Events }
  1518.     kRestEventDurationFieldPos    = 0;
  1519.     kRestEventDurationFieldWidth = 24;
  1520.     kRestEventDurationMax        = $00FFFFFF;                    {  Note Events }
  1521.     kNoteEventPitchFieldPos        = 18;
  1522.     kNoteEventPitchFieldWidth    = 6;
  1523.     kNoteEventPitchOffset        = 32;                            {  add to value in pitch field to get actual pitch  }
  1524.     kNoteEventVolumeFieldPos    = 11;
  1525.     kNoteEventVolumeFieldWidth    = 7;
  1526.     kNoteEventVolumeOffset        = 0;                            {  add to value in volume field to get actual volume  }
  1527.     kNoteEventDurationFieldPos    = 0;
  1528.     kNoteEventDurationFieldWidth = 11;
  1529.     kNoteEventDurationMax        = $000007FF;
  1530.     kXNoteEventPitchFieldPos    = 0;                            {  in the 1st long word  }
  1531.     kXNoteEventPitchFieldWidth    = 16;
  1532.     kXNoteEventDurationFieldPos    = 0;                            {  in the 2nd long word  }
  1533.     kXNoteEventDurationFieldWidth = 22;
  1534.     kXNoteEventDurationMax        = $003FFFFF;
  1535.     kXNoteEventVolumeFieldPos    = 22;                            {  in the 2nd long word  }
  1536.     kXNoteEventVolumeFieldWidth    = 7;                            {  Control Events }
  1537.     kControlEventControllerFieldPos = 16;
  1538.     kControlEventControllerFieldWidth = 8;
  1539.     kControlEventValueFieldPos    = 0;
  1540.     kControlEventValueFieldWidth = 16;
  1541.     kXControlEventControllerFieldPos = 0;                        {  in the 2nd long word  }
  1542.     kXControlEventControllerFieldWidth = 16;
  1543.     kXControlEventValueFieldPos    = 0;                            {  in the 1st long word  }
  1544.     kXControlEventValueFieldWidth = 16;                            {  Knob Events }
  1545.     kKnobEventValueHighFieldPos    = 0;                            {  1st long word  }
  1546.     kKnobEventValueHighFieldWidth = 16;
  1547.     kKnobEventKnobFieldPos        = 16;                            {  2nd long word  }
  1548.     kKnobEventKnobFieldWidth    = 14;
  1549.     kKnobEventValueLowFieldPos    = 0;                            {  2nd long word  }
  1550.     kKnobEventValueLowFieldWidth = 16;                            {  Marker Events }
  1551.     kMarkerEventSubtypeFieldPos    = 16;
  1552.     kMarkerEventSubtypeFieldWidth = 8;
  1553.     kMarkerEventValueFieldPos    = 0;
  1554.     kMarkerEventValueFieldWidth    = 16;                            {  General Events }
  1555.     kGeneralEventSubtypeFieldPos = 16;                            {  in the last long word  }
  1556.     kGeneralEventSubtypeFieldWidth = 14;
  1557.     kGeneralEventLengthFieldPos    = 0;                            {  in the 1st & last long words  }
  1558.     kGeneralEventLengthFieldWidth = 16;
  1559.  
  1560. {$IFC TARGET_RT_LITTLE_ENDIAN }
  1561.     kEndMarkerValue                = $00000060;
  1562.  
  1563. {$ELSEC}
  1564.     kEndMarkerValue                = $60000000;
  1565.  
  1566. {$ENDC}  {TARGET_RT_LITTLE_ENDIAN}
  1567.  
  1568. {  General Event Defined Types }
  1569.     kGeneralEventNoteRequest    = 1;                            {  Encapsulates NoteRequest data structure  }
  1570.     kGeneralEventPartKey        = 4;
  1571.     kGeneralEventTuneDifference    = 5;                            {  Contains a standard sequence, with end marker, for the tune difference of a sequence piece (halts QuickTime 2.0 Music)  }
  1572.     kGeneralEventAtomicInstrument = 6;                            {  Encapsulates AtomicInstrument record  }
  1573.     kGeneralEventKnob            = 7;                            {  knobID/knobValue pairs; smallest event is 4 longs  }
  1574.     kGeneralEventMIDIChannel    = 8;                            {  used in tune header, one longword identifies the midi channel it originally came from  }
  1575.     kGeneralEventPartChange        = 9;                            {  used in tune sequence, one longword identifies the tune part which can now take over this part's note channel (similar to program change) (halts QuickTime 2.0 Music) }
  1576.     kGeneralEventNoOp            = 10;                            {  guaranteed to do nothing and be ignored. (halts QuickTime 2.0 Music)  }
  1577.     kGeneralEventUsedNotes        = 11;                            {  four longwords specifying which midi notes are actually used, 0..127 msb to lsb  }
  1578.     kGeneralEventPartMix        = 12;                            {  three longwords: Fixed volume, long balance, long flags  }
  1579.  
  1580. {  Marker Event Defined Types        // marker is 60 ee vv vv in hex, where e = event type, and v = value }
  1581.     kMarkerEventEnd                = 0;                            {  marker type 0 means: value 0 - stop, value != 0 - ignore }
  1582.     kMarkerEventBeat            = 1;                            {  value 0 = single beat; anything else is 65536ths-of-a-beat (quarter note) }
  1583.     kMarkerEventTempo            = 2;                            {  value same as beat marker, but indicates that a tempo event should be computed (based on where the next beat or tempo marker is) and emitted upon export }
  1584.  
  1585.     kCurrentlyNativeEndian        = 1;
  1586.     kCurrentlyNotNativeEndian    = 2;
  1587.  
  1588. { UPP call backs }
  1589.     uppMusicMIDISendProcInfo = $00000FF0;
  1590.     uppMusicMIDIReadHookProcInfo = $000003F0;
  1591.     uppMusicOfflineDataProcInfo = $00000FF0;
  1592.     uppTuneCallBackProcInfo = $000003C0;
  1593.     uppTunePlayCallBackProcInfo = $00000FC0;
  1594.  
  1595. FUNCTION NewMusicMIDISendProc(userRoutine: MusicMIDISendProcPtr): MusicMIDISendUPP;
  1596.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1597.     INLINE $2E9F;
  1598.     {$ENDC}
  1599.  
  1600. FUNCTION NewMusicMIDIReadHookProc(userRoutine: MusicMIDIReadHookProcPtr): MusicMIDIReadHookUPP;
  1601.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1602.     INLINE $2E9F;
  1603.     {$ENDC}
  1604.  
  1605. FUNCTION NewMusicOfflineDataProc(userRoutine: MusicOfflineDataProcPtr): MusicOfflineDataUPP;
  1606.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1607.     INLINE $2E9F;
  1608.     {$ENDC}
  1609.  
  1610. FUNCTION NewTuneCallBackProc(userRoutine: TuneCallBackProcPtr): TuneCallBackUPP;
  1611.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1612.     INLINE $2E9F;
  1613.     {$ENDC}
  1614.  
  1615. FUNCTION NewTunePlayCallBackProc(userRoutine: TunePlayCallBackProcPtr): TunePlayCallBackUPP;
  1616.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1617.     INLINE $2E9F;
  1618.     {$ENDC}
  1619.  
  1620. FUNCTION CallMusicMIDISendProc(self: ComponentInstance; refCon: LONGINT; VAR mmp: MusicMIDIPacket; userRoutine: MusicMIDISendUPP): ComponentResult;
  1621.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1622.     INLINE $205F, $4E90;
  1623.     {$ENDC}
  1624.  
  1625. FUNCTION CallMusicMIDIReadHookProc(VAR mp: MusicMIDIPacket; myRefCon: LONGINT; userRoutine: MusicMIDIReadHookUPP): ComponentResult;
  1626.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1627.     INLINE $205F, $4E90;
  1628.     {$ENDC}
  1629.  
  1630. FUNCTION CallMusicOfflineDataProc(SoundData: Ptr; numBytes: LONGINT; myRefCon: LONGINT; userRoutine: MusicOfflineDataUPP): ComponentResult;
  1631.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1632.     INLINE $205F, $4E90;
  1633.     {$ENDC}
  1634.  
  1635. PROCEDURE CallTuneCallBackProc({CONST}VAR status: TuneStatus; refCon: LONGINT; userRoutine: TuneCallBackUPP);
  1636.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1637.     INLINE $205F, $4E90;
  1638.     {$ENDC}
  1639.  
  1640. PROCEDURE CallTunePlayCallBackProc(VAR event: UInt32; seed: LONGINT; refCon: LONGINT; userRoutine: TunePlayCallBackUPP);
  1641.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1642.     INLINE $205F, $4E90;
  1643.     {$ENDC}
  1644.  
  1645. {$ALIGN RESET}
  1646. {$POP}
  1647.  
  1648. {$SETC UsingIncludes := QuickTimeMusicIncludes}
  1649.  
  1650. {$ENDC} {__QUICKTIMEMUSIC__}
  1651.  
  1652. {$IFC NOT UsingIncludes}
  1653.  END.
  1654. {$ENDC}
  1655.